package com.archgeek.java.queuedrain;

import com.google.common.collect.Queues;

import java.util.List;
import java.util.concurrent.PriorityBlockingQueue;
import java.util.concurrent.TimeUnit;

/**
 * @author pizhihui
 * @date 2023-08-15 11:53
 */
public class DrainProrityDemo {


    private static java.util.concurrent.BlockingQueue<CreateBatchRequest> exportRedisTask = new java.util.concurrent.ArrayBlockingQueue(10000);


    public static void main(String[] args) {

        List<CreateBatchRequest> list = new java.util.ArrayList<CreateBatchRequest>();


        PriorityBlockingQueue<Comparable> priorityBlockingQueue = Queues.newPriorityBlockingQueue();



        try {
            Queues.drain(exportRedisTask, list, 1, 1, TimeUnit.MINUTES);
        } catch (Exception e) {

        }


    }



}
